#ifndef __STORMWIDGET_CONFIGMANAGE_CCDOWNLOADCONFIG_CDOWNLOADCONFIG_H
#define __STORMWIDGET_CONFIGMANAGE_CCDOWNLOADCONFIG_CDOWNLOADCONFIG_H

#include "ITaskEvent.h"
#include "IConfigManage.h"
#include "CommonDefine.h"


#define WM_DOWNLOADXML_COMPLETE   WM_USER + 10005
#define WM_DOWNLOADXML_START      WM_USER + 10006

class CConfigManage;

class CDownloadConfig:public ITaskEvent
{
public:
	explicit CDownloadConfig(CConfigManage* pParent,int nTaskNo,TASKTYPE nTaskType,IConfigManageCallBack* pCallBack);
	virtual ~CDownloadConfig(void);

	void OnDownloadComplete(CStdString strTaskNo,BOOL bSuccessed);
	void OnProcessCallBack(CStdString strTaskNo,long long dwLength, long long dwTotalSize);
	void OnErrorCallBack(CStdString strTaskNo,DWORD dwCode, LPCTSTR lpError);
	void OnSetupCompleteCallBack(CStdString strTaskNo,BOOL bSuccessed);
	void StartMessageLoop();
	void StartDownload();
	BOOL GetConfigInfo(int nTaskNo);
	void SetLocalMaterialZipPath(LPCTSTR lpctstrZipPath);
private:
	CConfigManage* m_pParent;
	IConfigManageCallBack* m_pCallBack;
	TASKTYPE m_nTaskType;
	int m_nCurrentTaskID;
	DWORD m_nCurrentThreadID;
	CStdString m_strLocalMaterialZipPath;
};
#endif // __STORMWIDGET_CONFIGMANAGE_CCDOWNLOADCONFIG_CDOWNLOADCONFIG_H